﻿namespace ElevatorDispatching
{
    public static class DirectionExtensions
    {
        /// <summary>
        /// 获取给定方向的翻转
        /// </summary>
        /// <param name="direction">给定的方向</param>
        /// <returns>翻转后的方向</returns>
        public static Direction Reverse(this Direction direction)
        {
            switch (direction)
            {
                case Direction.Up:
                    return Direction.Down;
                case Direction.Down:
                    return Direction.Up;
            }
            return Direction.Unspecified;
        }
    }
}
